<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::connection('mysql_log')->create('log_ad_postback_user', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('用户充值回传日志');

            $table->increments('id');
            $table->integer('user_id')->comment('用户ID')->unsigned()->default(0);
            $table->tinyInteger('is_postback')->comment('首充是否回传 0否 1是')->unsigned()->default(0);
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);

            $table->index('user_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('log_ad_postback_user');
    }
};
